﻿using System;
using System.ComponentModel;

namespace Ontube.Entities
{
    public class Comment : INotifyPropertyChanged
    {
        public string Id { get; set; }

        private bool isReplyComment;

        public string Title { get; set; }

        public string Content { get; set; }

        public DateTime Published { get; set; }

        public string VideoId { get; set; }

        public string ChannelId { get; set; }
        public UserInformation Author { get; set; }

        public bool IsReplyComment
        {
            get
            {
                return this.isReplyComment;
            }
            set
            {
                this.isReplyComment = value;
                RaisePropertyChanged("IsReplyComment");
            }
        }

        private Onetube.Entities.ChannelsQuery.Item channel;

        public Onetube.Entities.ChannelsQuery.Item Channel
        {
            get
            {
                return channel;
            }
            set
            {
                channel = value;
                RaisePropertyChanged("Channel");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            System.ComponentModel.PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;
            if (propertyChangedEventHandler != null)
            {
                propertyChangedEventHandler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
}